package view;

import java.io.File;
import javax.swing.filechooser.*;

/**
 * A Filter for a JFileChooser while shows only .olp files
 * 
 * @author Alexander Craig
 */
public class LevelPackFilter extends FileFilter {

	private static final String LEVEL_PACK_EXTENSION = ".olp";

	/**
	 * Determines what file types this filter will accept
	 */
    public boolean accept(File f) {
    	
        if (f.isDirectory()) {
            return true;
        }

        if(f.getName().endsWith(LEVEL_PACK_EXTENSION)) {
        	return true;
        }

        return false;
    }

    /**
     * The description of this filter
     */
    public String getDescription() {
        return "Pacman's Perilous Predicament Level Packs";
    }
}
